﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;

namespace FileSystem.Services.IServices {
    /// <summary>
    /// 内容导航服务接口
    /// </summary>
    public interface IContentNavigationService {
        /// <summary>
        /// 导航到页面
        /// </summary>
        /// <param name="pageKey">页面键</param>
        Task NavigateToAsync(string pageKey);

        /// <summary>
        /// 导航到页面
        /// </summary>
        /// <param name="pageKey">页面键</param>
        /// <param name="parameter">参数</param>
        /// <returns></returns>
        Task NavigateToAsync(string pageKey, object parameter);
    }

    /// <summary>
    /// 内容导航常量
    /// </summary>
    public static class ContentNavigationConstants {
        /// <summary>
        /// 桌面主页
        /// </summary>
        public const string MainPage = nameof(Views.MainPage);

        /// <summary>
        /// 文件系统页
        /// </summary>
        public const string FileSystemPage = nameof(Views.FileSystemPage);

        /// <summary>
        /// 系统设置页
        /// </summary>
        public const string SettingPage = nameof(Views.SettingPage);

        /// <summary>
        /// 系统用户页
        /// </summary>
        public const string UsersPage = nameof(Views.UsersPage);

        /// <summary>
        /// 添加用户页
        /// </summary>
        public const string AddUserPage = nameof(Views.AddUserPage);

        /// <summary>
        /// 编辑用户信息页
        /// </summary>
        public const string EditUserPage = nameof(Views.EditUserPage);

        /// <summary>
        /// 用户登录页
        /// </summary>
        public const string LoginPage = nameof(Views.LoginPage);

        /// <summary>
        /// 物理磁盘块页面
        /// </summary>
        public const string PhysicalDiskBlockPage = nameof(Views.PhysicalDiskBlockPage);

        /// <summary>
        /// 纸张页面
        /// </summary>
        public const string PaperPage = nameof(Views.PaperPage);

        /// <summary>
        /// 页面键-页面类型字典.
        /// </summary>
        public static readonly Dictionary<string, Type> PageKeyTypeDictionary =
            new Dictionary<string, Type> {
                {MainPage, typeof(Views.MainPage)},
                {FileSystemPage, typeof(Views.FileSystemPage)},
                {SettingPage, typeof(Views.SettingPage)},
                {UsersPage, typeof(Views.UsersPage)},
                {AddUserPage, typeof(Views.AddUserPage)},
                {EditUserPage, typeof(Views.EditUserPage)},
                {LoginPage, typeof(Views.LoginPage)},
                {PhysicalDiskBlockPage, typeof(Views.PhysicalDiskBlockPage)},
                {PaperPage, typeof(Views.PaperPage)},
            };
    }
}